import service from "@/utils/request";
import type { Response, PageResponse, CodeName, ListResponse } from "@/types/common";
import type { AttendRuleItem } from "@/types/attend/rule";
export const useAttendRulePageApi = (params: object) => {
  return service<any, Response<PageResponse<AttendRuleItem>>>({
    url: `/v1/attend/rule/page`,
    method: "GET",
    params,
  });
};

export const useAttendRuleQueryApi = (params: object) => {
  return service<any, Response<AttendRuleItem>>({
    url: `/v1/attend/rule/query`,
    method: "GET",
    params,
  });
};
export const useAttendRuleListApi = () => {
  return service<any, ListResponse<CodeName>>({
    url: `/v1/attend/rule/list`,
    method: "GET",
  });
};


export const useAttendRuleCreateApi = (data: object) => {
  return service({
    url: `/v1/attend/rule/create`,
    method: "POST",
    data,
  });
};

export const useAttendRuleUpdateApi = (data: object) => {
  return service({
    url: `/v1/attend/rule/update`,
    method: "POST",
    data,
  });
};

export const useAttendRuleDeleteApi = (data: object) => {
  return service({
    url: `/v1/attend/rule/delete`,
    method: "DELETE",
    data,
  });
};
